function [ all, c, ax, vx ] = PMCC_IITK(xxx)

[samples,sr] = wavread(xxx);
win = 400; 
hopfactor = 0.4;
p = 60;

samples = filter([1 -0.97], 1, samples);


hop = win*hopfactor;
Z = buffer(samples,win,win-hop);
P = size(Z,2);
hamming_okno = hamming(win);
oknovane_ramce_all = [];
for p = 1:P
    wind = Z(:,p);
    oknovane_ramce = hamming_okno.*wind;
    oknovane_ramce_all = [oknovane_ramce_all oknovane_ramce];
end
Sa_all = [];
Sp_all = [];
Sb_all = [];
L = size(Z,2);
for i = 1:L,
    x = oknovane_ramce_all(:,i);
    x = x-mean(x); %avoid DC
Nfft = 400;

[a,e] = dolpc_MVDR(x,p);
lenx = length(x);
%toc

%tic
for k = 0:p,
    i = [0:p-k];
    mu(k+1) = sum((p+1-k-2*i).*a(i+1).*conj(a(i+1+k)));
end
%toc

mu = [conj(mu(end:-1:2)) mu]/e;
lmu = length(mu);

    Wmat = exp(-sqrt(-1)*2*pi/Nfft*[0:Nfft/2-1]'*[0:(lmu-1)/2]);
    Pwa = Wmat*a';
    Sa = e./abs(Pwa).^2/(p+1); %/lenx;

    Wmat = exp(-sqrt(-1)*2*pi/Nfft*[0:Nfft/2-1]'*[-(lmu-1)/2:(lmu-1)/2]);
    Pwb = real(Wmat*mu');
    Sb = 1./Pwb;

    Sp = abs(fft(x,Nfft))/Nfft;
    Sp = Sp(1:Nfft/2).^2;    

    Sb_all = [Sb_all Sb];
    Sp_all = [Sp_all Sp];
    Sa_all = [Sa_all Sa];
end